package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.EntityDeviceModeMapper;
import com.ruoyi.system.domain.EntityDeviceMode;
import com.ruoyi.system.service.IEntityDeviceModeService;
import com.ruoyi.common.core.text.Convert;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-01-09
 */
@Service
public class EntityDeviceModeServiceImpl implements IEntityDeviceModeService 
{
    @Autowired
    private EntityDeviceModeMapper entityDeviceModeMapper;

    /**
     * 查询【请填写功能名称】
     * 
     * @param id 【请填写功能名称】ID
     * @return 【请填写功能名称】
     */
    @Override
    public EntityDeviceMode selectEntityDeviceModeById(Long id)
    {
        return entityDeviceModeMapper.selectEntityDeviceModeById(id);
    }

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param entityDeviceMode 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<EntityDeviceMode> selectEntityDeviceModeList(EntityDeviceMode entityDeviceMode)
    {
        return entityDeviceModeMapper.selectEntityDeviceModeList(entityDeviceMode);
    }

    /**
     * 新增【请填写功能名称】
     * 
     * @param entityDeviceMode 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertEntityDeviceMode(EntityDeviceMode entityDeviceMode)
    {
        entityDeviceMode.setCreateTime(DateUtils.getNowDate());
        return entityDeviceModeMapper.insertEntityDeviceMode(entityDeviceMode);
    }

    /**
     * 修改【请填写功能名称】
     * 
     * @param entityDeviceMode 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateEntityDeviceMode(EntityDeviceMode entityDeviceMode)
    {
        entityDeviceMode.setUpdateTime(DateUtils.getNowDate());
        return entityDeviceModeMapper.updateEntityDeviceMode(entityDeviceMode);
    }

    /**
     * 删除【请填写功能名称】对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteEntityDeviceModeByIds(String ids)
    {
        return entityDeviceModeMapper.deleteEntityDeviceModeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除【请填写功能名称】信息
     * 
     * @param id 【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteEntityDeviceModeById(Long id)
    {
        return entityDeviceModeMapper.deleteEntityDeviceModeById(id);
    }

    /**
     * 检测器材型号名称是否存在
     * @param modeName
     * @return
     */
    @Override
    public Long checkModeName(String modeName,Long id){
        return entityDeviceModeMapper.checkModeName(modeName,id);
    }

    /**
     * 自动补全
     * @param modeName
     * @param typeId
     * @return
     */
    @Override
    public List<EntityDeviceMode> queryValidModeByParam(String modeName, Long typeId){
        return entityDeviceModeMapper.queryValidModeByParam(modeName,typeId);
    }
}
